<template>
 <div class="business-list">
  <van-card
      v-for="business of businessList"
      :title="business.name"
      :desc="business.description"
      :thumb="business.mainImage"
      @click="$router.push(`/business/detail?id=${business.id}`)"
  />
 </div>
</template>

<script>
import axios from "axios";
export default {
    name: "list",
    data(){
     return{
      businessList:[]
     }
    },
    methods:{
      _initBusinessList(){
        axios.get('/ele_server/business/list').then(({data:res})=>{
         if (res.status == 0){
           this.businessList = res.data
         }else {
            alert(res.message)
          }
        })
      }
    },
    created() {
     this._initBusinessList()
    }
}
</script>

<style scoped>

</style>